﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace Cstudy.MODEL
{
    /// <summary>
    /// 用户
    /// </summary>
    public class users
    {
        public enum UserSex { Female, Male }

        private int userid;
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserID
        {
            get { return userid; }
            set { userid = value; }
        }
        private string username;
        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName
        {
            get { return username; }
            set { username = value; }
        }
        private string pwd;
        /// <summary>
        /// 用户密码
        /// </summary>
        public string Pwd
        {
            get { return pwd; }
            set { pwd = value; }
        }
        private string email;
        /// <summary>
        /// 用户邮箱
        /// </summary>
        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        private int userpower;
        /// <summary>
        /// 用户权限
        /// </summary>
        [DefaultValue("0")] 
        public int UserPower
        {
            get { return userpower; }
            set { userpower = value; }
        }
        private int sex;
        /// <summary>
        /// 用户性别
        /// </summary>
        public UserSex Sex
        {
            get
            {
                if (sex == 1)
                    return UserSex.Female;
                else
                    return UserSex.Male;
            }
            set
            {
                if (value == UserSex.Female)
                    sex = 1;
                else
                    sex = 0;
            }
        }
        private string nickname;
        /// <summary>
        /// 用户昵称
        /// </summary>
        public string NickName
        {
            get { return nickname; }
            set { nickname = value; }
        }
        private string telephone;
        /// <summary>
        /// 用户手机号
        /// </summary>
        public string Telephone
        {
            get { return telephone; }
            set { telephone = value; }
        }
        private string birth;
        /// <summary>
        /// 用户生日
        /// </summary>
        public string Birth
        {
            get { return birth; }
            set { birth = value; }
        }
        private string headimage;
        /// <summary>
        /// 用户头像地址
        /// </summary>
        public string Headimage
        {
            get { return headimage; }
            set { headimage = value; }
        }
        private string info;
        /// <summary>
        /// 用户简介
        /// </summary>
        public string Info
        {
            get { return info; }
            set { info = value; }
        }
        private int userscore;
        /// <summary>
        /// 用户积分
        /// </summary>
        public int UserScore
        {
            get { return userscore; }
            set { userscore = value; }
        }
        private DateTime lastlogin;
        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime LastLogin
        {
            get { return lastlogin; }
            set { lastlogin = value; }
        }
        private float longlogin;
        /// <summary>
        /// 用户在线时长
        /// </summary>
        public float LongLogin
        {
            get { return longlogin; }
            set { longlogin = value; }
        }
        private DateTime createdate;
        /// <summary>
        /// 用户注册时间
        /// </summary>
        public DateTime CreateDate
        {
            get { return createdate; }
            set { createdate = value; }
        }
    }
}
